package com.sneakxy.mybase4j.platform.provider;

import com.alibaba.dubbo.config.annotation.Service;

import com.sneakxy.mybase4j.base.provider.BaseProvider;

import com.sneakxy.mybase4j.platform.beans.AccountRole;
import com.sneakxy.mybase4j.platform.beans.AccountRoleId;

import com.sneakxy.mybase4j.platform.provider.IAccountRoleProvider;

import com.sneakxy.mybase4j.platform.repository.AccountRoleRepository;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * 
 * @author 潜行的青衣
 * @see
 */
@Service(version = "1.0.0", interfaceClass = IAccountRoleProvider.class)
@org.springframework.stereotype.Service
public class AccountRoleProvider extends BaseProvider<AccountRole, AccountRoleId, AccountRoleRepository> implements IAccountRoleProvider {

	@Autowired
	public AccountRoleProvider(AccountRoleRepository repository) {
		super(repository);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.provider.IAccountRoleProvider#findRoles(java.lang.String)
	 */
	@Override
	public List<String> findRoles(String account_id) {
		return this.getRepository().findRoles(account_id);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.provider.IAccountRoleProvider#deleteByRoleId(java.lang.String)
	 */
	@Override
	public int deleteByRoleId(String role_id) {
		return this.getRepository().deleteByRoleId(role_id);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.provider.IAccountRoleProvider#deleteByAccountId(java.lang.String)
	 */
	@Override
	public int deleteByAccountId(String account_id) {
		return this.getRepository().deleteByAccountId(account_id);
	}

}
